//
//  StartupViewController.m
//  HYSmileiOS
//
//  Created by alekye on 16/4/23.
//  Copyright © 2016年 heyou. All rights reserved.
//

#import "StartupViewController.h"
#import "HomeNaviController.h"
#import "TestNaviController.h"
#import "heyou.h"

@interface StartupViewController ()
- (IBAction)onButtonClicked:(id)sender;
- (IBAction)goHome:(id)sender;

@end

@implementation StartupViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view.
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}

- (void)viewDidAppear:(BOOL)animated {
    [super viewDidAppear:animated];
//    [self gotoHome];
}

/*
#pragma mark - Navigation

// In a storyboard-based application, you will often want to do a little preparation before navigation
- (void)prepareForSegue:(UIStoryboardSegue *)segue sender:(id)sender {
    // Get the new view controller using [segue destinationViewController].
    // Pass the selected object to the new view controller.
}
*/

- (IBAction)onButtonClicked:(id)sender {
#if 1
    UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Test" bundle:nil];
    TestNaviController * vc = [storyboard instantiateViewControllerWithIdentifier:NSStringFromClass([TestNaviController class])];
    [self presentViewController:vc animated:YES completion:nil];
#endif
    
    // 测试友盟 计数事件
    NSDictionary *dict = @{@"type" : @"desk", @"quantity" : @"3"};
    [MobClick event:@"purchase" attributes:dict];
    
//    [MobClick event:@"pay" attributes:@{@"iphone" : @"6s plus"} counter:21];
}

#pragma mark -- goto home module
- (IBAction)goHome:(id)sender {
    UIStoryboard *storyBoard = [UIStoryboard storyboardWithName:@"Home" bundle:nil];
    NSString *identifier = NSStringFromClass([HomeNaviController class]);
    HomeNaviController *vc = [storyBoard instantiateViewControllerWithIdentifier:identifier];
    [self presentViewController:vc animated:NO completion:nil];
    
    [MobClick event:@"Forward"];
    // 测试友盟 计数事件
//    NSDictionary *dict = @{@"type" : @"book", @"quantity" : @"3"};
//    [MobClick event:@"purchase" attributes:dict];
//    
//    [MobClick event:@"pay" attributes:@{@"book" : @"Swift Fundamentals"} counter:11];
}
@end
